<{include file="top.html" }>
</head>
<body>
<div class="xy-panel">
    <div class="xy-panel-top">
        <div class="xy-titlebar">
            <div class="xy-titlebar-left">
                <a class="insertBefore_left_arrow_gray" href="javascript:void(0);"></a>
            </div>
            <div class="xy-titlebar-title">兑换记录</div>
            <div class="xy-titlebar-right"></div>
        </div>
    </div>
    <div class="xy-panel-content" style="bottom:0;">
        <div class="xy-row vDirectionRow">
            <{if count($list)>0}>
            <dl class="illustrate">说明：卡券请到 <a href="<{u('Card/cardlist')}>">我的卡包</a> 中查看</dl>
            <ul class="exchange_box" id="exchangeLogMore">
                <{foreach from = $list item=item}>
                    <a href="<{u('info/?id='|cat:$item['id'])}>">
                        <li class="exchange_con">
                            <dl class="exchange_topic"><span class="time"><{'Y-m-d H:i'|date:$item.exchangeTime}></span><span class="state"><{$exchangeStatus[$item.status]}></span></dl>
                            <div class="exchange_bottom">
                                <span class="exsp"><img src="<{$preUploadUrl}><{$item.listPic}>" /></span>
                                <div class="ex_con">
                                    <h3 style="height: 2.0rem;"><{$item.titleList}></h3>
                                    <dl class="ex_box"><span class="xyjf"><i><{$item.point}></i>&nbsp;积分</span></dl>
                                    <dl class="ex_box2">市场参考价：<{$item.originalPrice}>元</dl>
                                </div>
                            </div>
                        </li>
                    </a>
                <{/foreach}>
            </ul>
            <div id="load_container">
                <a href="javascript:load_more();" id="load_more"><span>加载更多</span></a><br>
            </div>
            <{else}>
                <div class="none-box">
                <span class="exchange-icon"></span>
                <dl>您还没有兑换任何商品</dl>
                <div class="ui-button ui-button-2">
                    <a  href="<{u('PointMall/index')}>">去积分商城逛逛</a>
                </div>
                </div>
            <{/if}>
        </div>
    </div>
</div>
<{include file="signBody.html"}>

</body>
</html>
<script>


    //拖动加载
    var  flagData  =  true;
    var  flagAjax  =  true;
    var  page      =  2;
    //加载
    function  load_more(postData){

        $("#load_more").css({'background':'url("<{$preStaticUrl}>Wap/images/load.gif")  center  center  no-repeat;background-size:30px  30px;'});
        $("#load_more  span").html('正在加载...');
        if(!  flagAjax){
            return  false;
        }
        flagAjax  =  false;
        $.post("<{u('exchangeLogMore')}>",postData  ,  function(data){
            flagAjax  =  true;
            if(data.data)  {
                $("#"+postData.pos).append(data.data);
                $("#load_more  span").html('加载更多');
                page++;
                $("#load_more").css({'background':'url("<{$preStaticUrl}>Wap/images/load.gif")  center  center  no-repeat;background-size:30px  30px;'});
            }  else  {
                flagData  =  false;
                $("#load_container").html('<a  href="javascript:;"  id="load_more"><span>没有更多商品啦</span></a>');
                $("#load_more").css({'background':'url("")'}).css({'padding-top':'0'}).css({'top':'0px'}).css({'position':'relative'});
            }
        },'json');
    }
    var  tmp_scroll  =  0;
    //拖动加载
    function  scroll_load(postData){
        if  (tmp_scroll  ==  $(window).height()  +  $(window).scrollTop())  {
            return;
        }
        tmp_scroll  =  $(window).height()  +  $(window).scrollTop();
        var  jia_scroll  =  $(document).height()  -  ($(window).height()  +  $(window).scrollTop());
        if  (jia_scroll  <  100  &&  flagData)  {
            load_more(postData);
        }
    }
    $(window).scroll(function(){
        scroll_load({p:page,pos:"exchangeLogMore"});
    });

</script>


